<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //contant.js文件
        export const A =1;
        export const B =3;
        export const C =4;

        //test.html文件
        import*as constants from './constants.js'
        console.log(constants.A);//1
        console.log(constants.B);//3

        //test2.html 文件
        import{A,B}from './constants.js'
        console.log(A);//1
        console.log(B);//3


    </script>
</body>
</html>